import {request} from "@/plugins/request"
// 登录
export const login = data =>{
  return request({
    method:"POST",
    url:"/api/users/login",
    data
  })
}
// 注册
export const register = data =>{
  return request({
    method:"POST",
    url:"/api/users",
    data
  })
}
// 获取用户
export const getUser = () =>{
  return request({
    method:"get",
    url:"/api/user",
    // data
  })
}
// 更新信息
export const updataUser = data =>{
  return request({
    method:"put",
    url:"/api/user",
    data
  })
}

// 查看作者
export const getAuthor = author => {
  return request({
    method: "GET",
    url: `/api/profiles/${author}`
  })
}